package com.doctcloud.hisinfo.histable.domain.medrec;

import com.baomidou.mybatisplus.annotation.TableName;
import com.doctcloud.common.core.annotation.Excel;
import lombok.*;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

import static com.doctcloud.common.core.utils.StringUtils.trim;

/**
 * @ClassName 患者基础信息
 * @Author samula
 * @Descripe product by com.doctcloud
 * @Data 2025-09-23 3:05
 **/
//@TableName("pat_master_index")
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(of={"patientId"})
@ToString
public class PatMasterIndexDo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Excel(name = "患者ID")
    @NotBlank(message = "患者ID不得为空")
    private String patientId;
    @Excel(name = "患者姓名")
    @NotBlank(message = "患者姓名不得为空")
    private String name;
    @Excel(name = "性别")
    private String sex;
    @Excel(name = "身份")
    private String identity;
    @Excel(name = "费别")
    private String chargeType;
    @Excel(name = "出生日期")
    private Date dateOfBirth;
    @Excel(name = "出生地代码")
    private String birthPlace;
    @Excel(name = "国籍")
    private String citizenship;
    @Excel(name = "民族")
    private String nation;
    @Excel(name = "身份证号")
    private String idNo;

    @Data
    public static class primaryKey {
        private final String patientId;
        public primaryKey(String patientId) {
            this.patientId = patientId;
        }
    }

    public void setName(String name) {
        this.name = trim(name);
    }
}
